import {
  request,
  _post,
  _get,
  _put
} from '../request';

// 代理商创建销售单据
export function agengCreatOrder(data, header) {
  return _post({
    url: `crm/pt/agent-sale-tickets/action/create`,
    data,
    header
  });
}

export function getOrderListNew(data) {
  return _post({
    url: `crm/pt/agent-orders/action/list-page`,
    data,
  });
}

// 获取销售单据详情信息
export function orderDetail(data) {
  return _get({
    url: `crm/pt/agent-sale-tickets/action/detail`,
    data,
  });
}

// 订单详情
export function orderDetailNew(data) {
  return _get({
    url: `crm/pt/agent-orders/action/detail`,
    data,
  });
}


export function getOrderList(data) {
  return _post({
    url: `crm/pt/agent-orders/action/list-page`,
    data,
  });
}

//分页查询销售单据
export function dealSuggest(data) {
  return _post({
    url: `crm/pt/agent-sale-tickets/action/list-page`,
    data,
  });
}

//  订单付款
export function payorder(data) {
  return _post({
    url: `crm/pt/agent-orders/action/pay`,
    data,
  });
}

// 订单确认收货
export function confrimRecevie(data) {
  return _post({
    url: `crm/pt/agent-orders/action/confirm-receipt`,
    data,
  });
}

// 代理商取消订单


export function cancelorder(data) {
  return _post({
    url: `crm/pt/agent-orders/action/cancel`,
    data,
  });
}


export function adminCheckOrder(data) {
  return _post({
    url: `crm/pt/agent-orders/action/audit`,
    data,
  });
}

// 仓管对订单发货
export function delevieGoods(data) {
  return _post({
    url: `crm/pt/agent-orders/action/delivery`,
    data,
  });
}

// 出库信息

export function getStockInfo(id) {
  return _get({
    url: `crm/pt/agent-orders/action/warehouse-out-info?orderId=${id}`,
  });
}